package com.robusta.spreadsheet.describe.jaxb;

import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import java.io.InputStream;

import static javax.xml.bind.JAXBContext.newInstance;

public class Context {
    private final Unmarshaller instance;

    public Context() throws JAXBException {
        instance = newInstance(Workbook.class).createUnmarshaller();
    }

    public Workbook unmarshal(InputStream content) throws JAXBException {
        return (Workbook) instance.unmarshal(content);
    }
}
